﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Ket_noi_toi_VPP_bang_mo_hinh_ba_lop.VO;

namespace Ket_noi_toi_VPP_bang_mo_hinh_ba_lop.VO
{
    class UserVOKhachHang
    {
        private int _MaKH;
        private string _TenKH;
        private string _DiaChi;
        private string _GT;
        private string _DienThoai;
        private string _Email;

        public UserVOKhachHang(int MaKH, string TenKH, string DiaChi, string Gioitinh, string DienThoai, string Email)
        {
            this._MaKH = MaKH;
            this._TenKH = TenKH;
            this._DiaChi = DiaChi;
            this._GT = Gioitinh;
            this._DienThoai = DienThoai;
            this._Email = Email;
        }

        public int MAKHACHHANG
        {
            get { return _MaKH; }
            set { _MaKH = value; }
        }

        public string TENKHACHHANG
        {
            get { return _TenKH; }
            set { _TenKH = value; }
        }

        public string DIACHI
        {
            get { return _DiaChi; }
            set { _DiaChi = value; }
        }

        public string GIOITINH
        {
            get { return _GT; }
            set { _GT = value; }
        }

        public string DIENTHOAI
        {
            get { return _DienThoai; }
            set { _DienThoai = value; }
        }

        public string EMAIL
        {
            get { return _Email; }
            set { _Email = value; }
        }

        public void CreateFormCTHD(DataRow dr)
        {
            if (dr != null)
            {
                this._MaKH = dr.IsNull(0) ? 0 : Convert.ToInt32(dr[0]);
                this._TenKH = dr.IsNull(1) ? string.Empty : Convert.ToString(dr[1]);
                this._DiaChi = dr.IsNull(2) ? string.Empty : Convert.ToString(dr[2]);
                this._GT = dr.IsNull(3) ? string.Empty : Convert.ToString(dr[3]);
                this._DienThoai = dr.IsNull(4) ? string.Empty : Convert.ToString(dr[4]);
                this._Email = dr.IsNull(5) ? string.Empty : Convert.ToString(dr[5]);
            }
        }
    }
}
